﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace HZ.Supervise.Web.Secondphase
{
    public partial class ReportOfYear : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Databing();                
            }
        }
        public void Databing()
        {
            //<asp:BoundField DataField="GoodsInfo" HeaderText="流水号" ReadOnly="true" />
            //    <asp:BoundField DataField="ProductName" HeaderText="通用名称" ReadOnly="true" />
            //    <asp:BoundField DataField="MedicineModelName" HeaderText="剂型" ReadOnly="true" />
            //    <asp:BoundField DataField="Outlookc" HeaderText="规格" ReadOnly="true" />
            //    <asp:BoundField DataField="Unit" HeaderText="单位" ReadOnly="true" />
            //    <asp:BoundField DataField="Factor" HeaderText="系数" ReadOnly="true" />
            //    <asp:BoundField DataField="ProcurePrice" HeaderText="采购限价" ReadOnly="true" />
            //    <asp:BoundField DataField="CompanyName_Sc" HeaderText="生产企业" ReadOnly="true" />
            //    <asp:BoundField DataField="PurchaseNumerbTotalc" HeaderText="采购总数量" ReadOnly="true" />
            //    <asp:BoundField DataField="PurchaseAmountTotal" HeaderText="采购总金额" ReadOnly="true" />
            //    <asp:BoundField DataField="LastMonthRanked" HeaderText="上月排名" ReadOnly="true" />
            //    <asp:BoundField DataField="RankedChange" HeaderText="名次变化" ReadOnly="true" />
            DataTable dt = new DataTable();
            DataColumn dc1 = new DataColumn("hospital", typeof(string)); dt.Columns.Add(dc1);
            //DataColumn dc2 = new DataColumn("PurchaseNumerbTotalc", typeof(string)); dt.Columns.Add(dc2);
            DataColumn dc2 = new DataColumn("PurchaseNumerbTotalc_jb", typeof(string)); dt.Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("PurchaseNumerbTotalc_fjb", typeof(string)); dt.Columns.Add(dc3);
            // DataColumn dc5 = new DataColumn("PurchaseAmountTotal", typeof(string)); dt.Columns.Add(dc5);
            DataColumn dc4 = new DataColumn("PurchaseAmountTotal_jb", typeof(string)); dt.Columns.Add(dc4);
            DataColumn dc5 = new DataColumn("PurchaseAmountTotal_fjb", typeof(string)); dt.Columns.Add(dc5);
            //DataColumn dc8 = new DataColumn("LastMonthRanked", typeof(string)); dt.Columns.Add(dc8);
            // DataColumn dc9 = new DataColumn("RankedChange", typeof(string)); dt.Columns.Add(dc9);

            DataColumn dc6 = new DataColumn("PurchaseNumerbTotalc_jb1", typeof(string)); dt.Columns.Add(dc6);
            DataColumn dc7 = new DataColumn("PurchaseNumerbTotalc_fjb1", typeof(string)); dt.Columns.Add(dc7);
            // DataColumn dc5 = new DataColumn("PurchaseAmountTotal", typeof(string)); dt.Columns.Add(dc5);
            DataColumn dc8 = new DataColumn("PurchaseAmountTotal_jb2", typeof(string)); dt.Columns.Add(dc8);
            DataColumn dc9 = new DataColumn("PurchaseAmountTotal_fjb2", typeof(string)); dt.Columns.Add(dc9);

            DataColumn dc10 = new DataColumn("PurchaseAmountTotal_fjb3", typeof(string)); dt.Columns.Add(dc10);
            DataColumn dc11 = new DataColumn("PurchaseAmountTotal_fjb4", typeof(string)); dt.Columns.Add(dc11);
            DataColumn dc12 = new DataColumn("PurchaseAmountTotal_fjb5", typeof(string)); dt.Columns.Add(dc12);
            DataColumn dc13 = new DataColumn("PurchaseAmountTotal_fjb6", typeof(string)); dt.Columns.Add(dc13);
            DataColumn dc14 = new DataColumn("PurchaseAmountTotal_fjb7", typeof(string)); dt.Columns.Add(dc14);
            DataColumn dc15 = new DataColumn("PurchaseAmountTotal_fjb8", typeof(string)); dt.Columns.Add(dc15);
            DataColumn dc16 = new DataColumn("PurchaseAmountTotal_fjb9", typeof(string)); dt.Columns.Add(dc16);
            DataColumn dc17 = new DataColumn("PurchaseAmountTotal_fjb10", typeof(string)); dt.Columns.Add(dc17);
            DataColumn dc18 = new DataColumn("PurchaseAmountTotal_fjb11", typeof(string)); dt.Columns.Add(dc18);
            DataColumn dc19 = new DataColumn("PurchaseAmountTotal_fjb12", typeof(string)); dt.Columns.Add(dc19);
            DataColumn dc20 = new DataColumn("PurchaseAmountTotal_fjb13", typeof(string)); dt.Columns.Add(dc20);
            DataColumn dc21 = new DataColumn("PurchaseAmountTotal_fjb14", typeof(string)); dt.Columns.Add(dc21);
            DataColumn dc22 = new DataColumn("PurchaseAmountTotal_fjb15", typeof(string)); dt.Columns.Add(dc22);
            DataColumn dc23 = new DataColumn("PurchaseAmountTotal_fjb16", typeof(string)); dt.Columns.Add(dc23);
            DataColumn dc24 = new DataColumn("PurchaseAmountTotal_fjb17", typeof(string)); dt.Columns.Add(dc24);
            DataColumn dc25 = new DataColumn("PurchaseAmountTotal_fjb18", typeof(string)); dt.Columns.Add(dc25);
            for (int i = 0; i < 10; i++)
            {
                DataRow dr = dt.NewRow();
                dr[0] = "昆明地市" + i.ToString();
                dr[1] = "1000";
                dr[2] = "300";
                dr[3] = "600";
                dr[4] = "90000.000";
                dr[5] = "20000.000";
                dr[6] = "70000.00";
                dr[7] = "60000.00";
                dr[8] = "40000.00";
                dr[9] = "40000.00";
                dr[10] = "40000.00";
                dr[11] = "40000.00";
                dr[12] = "40000.00";
                dr[13] = "40000.00";
                dr[14] = "40000.00";
                dr[15] = "40000.00";
                dr[16] = "40000.00";
                dr[17] = "40000.00";
                dr[18] = "40000.00";
                dr[19] = "40000.00";
                dr[20] = "40000.00";
                dr[21] = "40000.00";
                dr[22] = "40000.00";
                dr[23] = "40000.00";
                dr[24] = "40000.00";
                dt.Rows.Add(dr);
            }

            gvwProcureCatalog.DataSource = dt;
            gvwProcureCatalog.DataBind();
        }
        protected void gvwProcureCatalog_RowCreated(object sender, GridViewRowEventArgs e)
        {
            switch (e.Row.RowType)
            {
                case DataControlRowType.Header:

                    //取得下拉框的月份


                    //第一行表头
                    TableCellCollection tcHeader = e.Row.Cells;
                    tcHeader.Clear();
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[0].Attributes.Add("colspan", "1"); //跨Row
                    tcHeader[0].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[0].Attributes.Add("bgcolor", "white");
                    tcHeader[0].Text = "";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[1].Attributes.Add("bgcolor", "Red");
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[1].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[1].Text = "1月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[2].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[2].Text = "2月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[3].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[3].Text = "3月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[4].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[4].Text = "4月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[5].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[5].Text = "5月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[6].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[6].Text = "6月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[7].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[7].Text = "7月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[8].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[8].Text = "8月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[9].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[9].Text = "9月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[10].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[10].Text = "10月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[11].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[11].Text = "11月";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[12].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[12].Text = "12月";
                    tcHeader.Add(new TableHeaderCell());                 
                    tcHeader[13].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[13].Text = "</th></tr><tr>";



                    //第2行表头
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[14].Attributes.Add("bgcolor", "LightSteelBlue");
                    tcHeader[14].Text = "";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[15].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[15].Attributes.Add("colspan", "2");
                    tcHeader[15].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[16].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[16].Attributes.Add("colspan", "2");
                    tcHeader[16].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[17].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[17].Attributes.Add("colspan", "2");
                    tcHeader[17].Text = "采购总金额【222222】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[18].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[18].Attributes.Add("colspan", "2");
                    tcHeader[18].Text = "配送总金额【40】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[19].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[19].Attributes.Add("colspan", "2");
                    tcHeader[19].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[20].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[20].Attributes.Add("colspan", "2");
                    tcHeader[20].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[21].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[21].Attributes.Add("colspan", "2");
                    tcHeader[21].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[22].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[22].Attributes.Add("colspan", "2");
                    tcHeader[22].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());//5月
                    tcHeader[23].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[23].Attributes.Add("colspan", "2");
                    tcHeader[23].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[24].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[24].Attributes.Add("colspan", "2");
                    tcHeader[24].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[25].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[25].Attributes.Add("colspan", "2");
                    tcHeader[25].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[26].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[26].Attributes.Add("colspan", "2");
                    tcHeader[26].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[27].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[27].Attributes.Add("colspan", "2");
                    tcHeader[27].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[28].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[28].Attributes.Add("colspan", "2");
                    tcHeader[28].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[29].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[29].Attributes.Add("colspan", "2");
                    tcHeader[29].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[30].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[30].Attributes.Add("colspan", "2");
                    tcHeader[30].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[31].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[31].Attributes.Add("colspan", "2");
                    tcHeader[31].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[32].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[32].Attributes.Add("colspan", "2");
                    tcHeader[32].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[33].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[33].Attributes.Add("colspan", "2");
                    tcHeader[33].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[34].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[34].Attributes.Add("colspan", "2");
                    tcHeader[34].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());//11月
                    tcHeader[35].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[35].Attributes.Add("colspan", "2");
                    tcHeader[35].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[36].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[36].Attributes.Add("colspan", "2");
                    tcHeader[36].Text = "配送总金额【30】";

                    tcHeader.Add(new TableHeaderCell());//12月
                    tcHeader[37].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[37].Attributes.Add("colspan", "2");
                    tcHeader[37].Text = "采购总金额【11111】";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[38].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[38].Attributes.Add("colspan", "2");
                    tcHeader[38].Text = "配送总金额【30】";

               
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[39].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[39].Text = "操作";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[40].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[40].Text = "图表</th></tr><tr>";
                    break;
                    ////第3行表头
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[10].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[10].Text = "生产企业";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[11].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[11].Text = "基药总金额";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[12].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[12].Text = "非基药总金额";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[13].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[13].Text = "基药总数量";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[14].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[14].Text = "非基药总数量";

                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[15].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[15].Text = "基药总金额";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[16].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[16].Text = "非基药总金额";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[17].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[17].Text = "基药总数量";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[18].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[18].Text = "非基药总数量";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[19].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[19].Text = "操作";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[20].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[20].Text = "图表</th></tr><tr>";
                    //break;
            }
        }
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {

        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            Databing();
        }

        protected void lbnSwitch_Click(object sender, EventArgs e)
        {

        }

        protected void btnExcel_Click(object sender, EventArgs e)
        {

        }

        protected void lbtnSee_Click(object sender, EventArgs e)
        {

        }      
    }
}
